<template>
  <div class="cs-dialog">
    <el-dialog
      custom-class="zIndex-popper"
      :title="title"
      :visible.sync="dialogVisible"
      width="900px"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :show-close="false">
      <slot></slot>
      <span slot="footer" class="dialog-footer">
        <el-button @click="reset">重 置</el-button>
        <el-button @click="close">关 闭</el-button>
        <el-button type="primary" @click="sure">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script type="text/ecmascript-6">
  export default {
    name: 'cs-dialog',
    props: {
      // 控制dialog显示关闭
      dialogVisible: {
        type: Boolean,
        default: false
      },
      // dialog头部
      title: {
        type: String,
        default: '提示'
      }
    },
    methods: {
      // 重置方法
      reset () {
        this.$emit('reset')
      },
      // 关闭方法
      close () {
        this.$emit('close')
      },
      // 确定方法
      sure () {
        this.$emit('sure')
      }
    }
  }
</script>
